<?php
class Manager extends AppModel {
	var $name = 'Manager';
        var $useTable="users";
	var $displayField = 'name';
	//The Associations below have been created with all possible keys, those that are not needed can be removed
        var $virtualFields=array(
            'fullName'=>'CONCAT(Manager.name," ",Manager.surname," - ",Manager.id_code," - ",Manager.id_erp)',
            'strName'=>'CONCAT(SUBSTR(Manager.surname,1,1),".",Manager.name)',
            'UsName'=>'CONCAT(Manager.surname," ",Manager.name)',
            'display'=>'CONCAT(Manager.surname," ",Manager.name)'
        );
	var $belongsTo = array(
		'Backup' => array(
			'className' => 'Backup',
			'foreignKey' => 'backup_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Manager' => array(
			'className' => 'Manager',
			'foreignKey' => 'manager_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Hrreferent' => array(
			'className' => 'Hrreferent',
			'foreignKey' => 'hrreferent_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Status' => array(
			'className' => 'Status',
			'foreignKey' => 'status_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Jobfunction' => array(
			'className' => 'Jobfunction',
			'foreignKey' => 'jobfunction_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Securitygroup' => array(
			'className' => 'Securitygroup',
			'foreignKey' => 'securitygroup_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Company' => array(
			'className' => 'Company',
			'foreignKey' => 'company_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Group' => array(
			'className' => 'Group',
			'foreignKey' => 'group_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Dmdform' => array(
			'className' => 'Dmdform',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Formstatus' => array(
			'className' => 'Formstatus',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);


	var $hasAndBelongsToMany = array(
		'Jobprofile' => array(
			'className' => 'Jobprofile',
			'joinTable' => 'jobprofiles_users',
			'foreignKey' => 'user_id',
			'associationForeignKey' => 'jobprofile_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

}
?>